<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 18-9-27
 * Time: 上午10:52
 */

namespace app\model;

use think\model\concern\SoftDelete;
use think\Model;

class Activity extends Base
{
    protected $pk = 'id';
    // 此处表名请务必设置为public
    public $table = 'activity';
    protected $json = [
        'light_spot',
        'slider'
    ];
    // 软删除
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;
    public function total(array $where = []): int
    {
        return (int)$this
            ->where($where)
            ->count();
    }
}